refactor(frontend): centralize logging and forbid console usage#757
refactor(frontend): centralize logging and forbid console usage#757adityabhatkar23 wants to merge 3 commits into
Conversation
|
heads up: main's ci was broken (the Backend CI and Backend Docker Image CI jobs) until the fixes in #969 and #974 just landed, so the red backend/docker checks on this pr are almost certainly stale, they ran against the broken main. please rebase to re-test against the now-green main: |
|
clean frontend logger refactor, tsc passes, the only red is an unrelated backend auth test (your pr is 100% frontend). stale base, rebase and it'll go green: |
Description
Centralize frontend logging behind a dedicated logger utility, replace direct
console.*usage across the frontend, and enforce the pattern through ESLint.Type of Change
Related Issues
Closes #628
Changes Made
frontend/src/lib/logger.tsas a centralized logging utilityconsole.error,console.warn, andconsole.infocalls with logger helpersconsole.*usage outside the logger modulesrc/utils/amount.tsTesting
Test Coverage
Test Steps
npm run lintconsole.log(...)statement in a frontend source filenpm run lintand verify theno-consolerule is triggeredBreaking Changes
Breaking Changes:
Migration Guide:
Screenshots/Demo
N/A
Checklist
Additional Notes
src/components/stream-creation/__tests__/template-storage.test.tsappear to be unrelated to this change and are caused by a pre-existinglocalStorage.clear is not a functionerror.